
<script type="text/javascript">

    $(document).ready(function() {


        //$("#id").autoNumeric({aSep: '.', aDec: ','});


        $("#btn_pilih_rekening").click(function() {
            //alert('aaa');
            $("#dialog-rekening").dialog('open');
        });

        $("#btn_pilih_npwpd").click(function() {
            $("#dialog-datanpwpd").dialog('open');
        });

    });

    function PilihRekening(aa) {
        var cc = aa.split("#");
        $("#no_rekening").val(cc[0]);        
        $("#nama_rekening").val(cc[1]);

        $("#dialog-rekening").dialog('close');
    }


    function PilihDataNpwpd(aa) {
        var cc = aa.split("#");
	
	//function untuk memecah string
        $("#npwpd").val(cc[0]);
		 var npwpd1=cc[0].substr(0,1); //dimulai dari string ke 0 di ambil 1 string
		 var npwpd2=cc[0].substr(1,1);
		 var npwpd3=cc[0].substr(2,7); //dimulai dari string ke 2 di ambil 7 string
		 var npwpd4=cc[0].substr(9,2); //dimulai dari string ke 9 di ambil 2 string
		 var npwpd5=cc[0].substr(11,3); //dimulai dari string ke 11 di ambil 3 string
		 
        $("#npwpd1").val(npwpd1);
		$("#npwpd2").val(npwpd2);
		$("#npwpd3").val(npwpd3);
		$("#npwpd4").val(npwpd4);
		$("#npwpd5").val(npwpd5);
        		
		
        $("#nama_npwpd").val(cc[1]);        
        $("#alamat_npwpd").val(cc[2]);
		$("#kelurahan_npwpd").val(cc[3]);
		$("#kecamatan_npwpd").val(cc[4]);
		$("#kabupaten_npwpd").val(cc[5]);
		
        $("#dialog-datanpwpd").dialog('close');
    }




</script>


<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'horizontalForm',
    'type' => 'horizontal',
    'enableAjaxValidation' => false,
//    'action'=>Yii::app()->createUrl('');
        ));
?>
<legend>Entry SPTPD Restoran</legend>
<br>

<?php echo $form->errorSummary($model); ?>

<div class="alert alert-success">A. Pajak Masa Sekarang </div>
<div class="form">
    <br>
    <div class="control-group">
        <label class="control-label" >No.SPTPD </label>
        <div class="controls">
        <input type="text" class="span3" readonly value="HTL140200003">         
        <label class="control-label" >Tgl. SPTPD</label>   
        <div style="position: absolute; right: 360px; top: 192px; width: 200px;">
            <div class="input-group">
                <span class="input-group-addon"><i class="icon-calendar"></i></span>
                <?php
                $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                    'model' => $model,
                    'attribute' => 'tanggal_kk',
                    // additional javascript options for the date picker plugin
                    'options' => array(
                        'yearRange' => 'c-50:c+20',
                    ),
                ));
                ?>
            </div>
        </div>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" >NPWPD</label>

        <input type="text" class="span1" style="width: 30px;" readonly id="npwpd1">
        <input type="text" class="span1" style="width: 20px;" readonly id="npwpd2">
        -
        <input type="text" class="span2" readonly id="npwpd3">
        -
        <input type="text" class="span1" style="width: 20px;" readonly id="npwpd4">
        -
        <input type="text" class="span1" style="width: 30px;" readonly id="npwpd5">
        <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'type' => 'info',
                'label' => 'Cari NPWPD (F9)',
                'htmlOptions' => array('id' => 'btn_pilih_npwpd')
            ));
            ?>
    </div>

    <div class="control-group"  style="width: 100%">
        <label class="control-label">Wajib Pajak </label>
        <div class="controls">
            <input type="text" class="span4" readonly id="nama_npwpd">
        </div>
    </div>

    <div class="kanan" style="margin-left:50px;">
        <div class="control-group ">
            <label class="control-label">- Alamat </label>
            <div class="controls">
                <input type="text" class="span4" readonly id="alamat_npwpd">
            </div>
        </div>
        <div class="control-group ">
            <label class="control-label">- Kelurahan/Desa </label>
            <div class="controls">
                <input type="text" class="span3" readonly id="kelurahan_npwpd">
            </div>
        </div>
        <div class="control-group ">
            <label class="control-label">- Kecamatan </label>
            <div class="controls">
                <input type="text" class="span3" readonly id="kecamatan_npwpd">
            </div>
        </div>
        <div class="control-group ">
            <label class="control-label">- Kabupaten </label>
            <div class="controls">
                <input type="text" class="span3" readonly id="kabupaten_npwpd">
            </div>
        </div>
    </div>
    <div class="control-group ">
        <label class="control-label">No.Rekening </label>
        <div class="controls">
            <input type="text" class="span2" id="no_rekening">
            <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'type' => 'info',
                'label' => 'F1',
                'htmlOptions' => array('id' => 'btn_pilih_rekening')
            ));
            ?>
            <label class="control-label">Nama Rekening </label>
            <input type="text" class="span3" readonly id="nama_rekening">
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" >Cara Hitung</label>         
        <div class="controls">       
            <?php
            echo $form->DropDownList($model, 'no_telepon', array(
                'prompt' => 'Pilih',
                '0' => 'Self Assessment (SA)',
                '1' => 'Office Assessment (OS)',
                    ), array('class' => 'span3'));
            ?>
        </div>
    </div>
    
    <div class="control-group ">
        <label class="control-label" >Masa Pajak</label>
        <div class="controls">
            <?php
            echo $form->DropDownList($model, 'no_telepon', array(
                'prompt' => 'Pilih',
                '0' => 'Self Assessment (SA)',
                '1' => 'Office Assessment (OS)',
                    ), array('class' => 'span3'));
            ?>            
        </div>
    </div>
    
    <div class="row-fluid" style="width: 100%">
        <div class="span4">
            <div class="control-group">
                <label class="control-label" >Tanggal</label>
                <div class="input-group">
                    <span class="input-group-addon"><i class="icon-calendar"></i></span>
                    <?php
                        $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                        'model' => $model,
                        'attribute' => 'tanggal_kk',
                        // additional javascript options for the date picker plugin
                        'options' => array(
                        'yearRange' => 'c-50:c+20',
                        ),
                        ));
                    ?>
                </div>
            </div>
        </div>        

        <div class="span4">
            <div class="control-group ">
                <label class="control-label" >Sampai Dengan</label>
                <div class="input-group">
                    <span class="input-group-addon"><i class="icon-calendar"></i></span>
                    <?php
                        $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                        'model' => $model,
                        'attribute' => 'tanggal_kk',
                        // additional javascript options for the date picker plugin
                        'options' => array(
                        'yearRange' => 'c-50:c+20',
                        ),
                        ));
                    ?>
                </div>
            </div>
        </div>
    </div>

<div class="control-group ">
        <label class="control-label" >Tahun Pajak</label>
        <div class="controls">
            <?php
            echo $form->DropDownList($model, 'no_telepon', array(
                'prompt' => 'Pilih',
                '0' => '2014',
                '1' => '2015',
                '1' => '2016',
                '1' => '2017',
                    ), array('class' => 'span1'));
            ?>
          </div>
    </div>

    <div class="control-group ">
        <label class="control-label" >Tarif </label>
        <div class="controls">
            <input type="text" class="span2" placeholder="0" >
            %
        </div>
    </div>
    <div class="control-group ">
        <label class="control-label" >Omzet </label>
        <div class="controls">
            <input type="text" class="span2" placeholder="0.00" >

        </div>
    </div>
    <div class="control-group ">
        <label class="control-label" >Pajak Terhutang </label>
        <div class="controls">
            <input type="text" class="span2" placeholder="0.00" >

        </div>
    </div>
    <div class="control-group ">
        <label class="control-label">Bunga </label>
        <div class="controls">
            <input type="text" class="span1" placeholder="0" >
            %=
            <input type="text" class="span1" placeholder="0.00" readonly >
        </div>
    </div>
    <div class="control-group ">
        <label class="control-label">Denda </label>
        <div class="controls">
            <input type="text" class="span1" placeholder="0" >
            %=
            <input type="text" class="span1" placeholder="0.00" readonly >
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" >Total Pajak Terhutang </label>
        <div class="controls">
            <input type="text" class="span3" readonly placeholder="0.00" >
        </div>
    </div>
    <div class="control-group ">
        <label class="control-label" >Keterangan </label>
        <div class="controls">
            <input type="textarea" class="span3" >
        </div>
    </div>
</div>
<br>
    <div class="alert alert-success">B. Pajak Sebelumnya </div>
    <div class="form">
        <br>
    <div class="control-group ">
        <label class="control-label" >Masa Pajak/Tahun</label>
        <div class="controls">
            <?php
            echo $form->DropDownList($model, 'no_telepon', array(
                'prompt' => 'Pilih',
                '0' => 'Januari',
                '1' => 'Februari',
                '1' => 'Maret',
                '1' => 'April',
                    ), array('class' => 'span3'));
            ?>
            <?php
            echo $form->DropDownList($model, 'no_telepon', array(
                'prompt' => 'Pilih',
                '0' => '2014',
                '0' => '2015',
                '0' => '2016',
                '0' => '2017',
                
                    ), array('class' => 'span1'));
            ?>
          </div>
    </div>

    <div class="control-group ">
        <label class="control-label" >Tarif </label>
        <div class="controls">
            <input type="text" class="span2" placeholder="0" >
            %
        </div>
    </div>
    <div class="control-group ">
        <label class="control-label" >Omzet </label>
        <div class="controls">
            <input type="text" class="span2" placeholder="0.00" >

        </div>
    </div>
    <div class="control-group ">
        <label class="control-label" >Pajak Terhutang </label>
        <div class="controls">
            <input type="text" class="span2" placeholder="0.00" >

        </div>
    </div>
    </div>
    <br>

 <div class="alert alert-success">C. Tarif dan Jumlah Meja </div>
 <div class="form">
     <br>
     
 <div class="control-group ">
        <label class="control-label" >Jumlah Meja </label>
        <div class="controls">
            <input type="text" class="span2" placeholder="0.00" >

        </div>
    </div>

 <div class="control-group ">
        <label class="control-label" >Pajak Terhutang </label>
        <div class="controls">
            <input type="text" class="span2" placeholder="0.00" >

        </div>
    </div>

 
 <div class="control-group ">
        <div class="controls">
    <?php echo $form->checkBoxList($model, 'nomor_kk', array(
        'Kas Register',
        'Pembukuan/Pencatatan',
        'Komputerisasi FO/BO',
    )); ?>

        </div>
    </div>
 
    <div class="control-group ">

        <div class="controls">
    <?php echo $form->checkBoxList($model, 'nomor_kk', array(
        'Persewaan Ruangan',

    )); ?>
        <label class="control-label" >Jumlah Ruangan </label>
        <input type="text" class="span2" placeholder="0">
           <br>
           <br>
        <label class="control-label" >Tarif </label>
        <input type="text" class="span2" placeholder="0.00" >
            </div>
    </div>
 
    <div class="control-group ">
        <div class="controls">
    <?php echo $form->checkBoxList($model, 'nomor_kk', array(
        'Ruang Pertemuan',

    )); ?>
        <label class="control-label" >Jumlah Ruangan </label>
           <input type="text" class="span2" >
           <br>
           <br>
        <label class="control-label" >Tarif </label>
           <input type="text" class="span2" >
    

        </div>
    </div>
 
    <div class="control-group ">
        <div class="controls">
            <label class="control-label" style="width: 200px" >Harga Rata-rata Makanan Per Orang </label>
            <br>
            <input type="text" style="margin-left:50px;" class="span2" placeholder="0.00">
        </div>
        <div class="controls">
           <label class="control-label" style="width: 200px">Harga Rata-rata Minuman Per Orang</label>
           <br>
           <input type="text" style="margin-left:50px;" class="span2" placeholder="0.00" >
    

        </div>
    </div>

    
 
    
 </div>

    <div class="form-actions">
<?php
$this->widget('bootstrap.widgets.TbButton', array(
    'buttonType' => 'submit',
    'type' => 'primary',
    'label' => $model->isNewRecord ? 'Simpan' : 'Save',
));
?>
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'primary',
            'label' => $model->isNewRecord ? 'Batal' : 'Reset',
        ));
        ?>

    </div>


<?php $this->endWidget(); ?>

 <?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
    'id' => 'dialog-rekening',
    'options' => array(
        'title' => 'Cari Data Rekening',
        'overflow' => 'scroll',
        'width' => 900,
        'height' => 500,
        'autoOpen' => false,
    //'buttons' => array(
    //    'Ok' => 'js:function(){$(this).dialog("close")}',),
    ),
));
?>

<?php
Yii::app()->clientScript->registerScript('rekening', "
			$('form#rekening').submit(function(){
				$.fn.yiiGridView.update('Rekening', {
					data: $(this).serialize()
				});
				return false;
			});
		
		");
?>

<form method="get" class="form-horizontal" action="<?php echo Yii::app()->createUrl($this->route); ?>" id="rekening">
    <div class="alert alert-info">
        <div class="control-group">
            <label class="control-label">Kode Pengelola </label>
            <div class="controls">
                <input type="text" class="span3" name="Pengelola[kode_skpd]" id="pengelola_kode_skpd" /> 
            </div>
        </div>

        <div class="control-group">
            <label class="control-label">Nama Pengelola </label>
            <div class="controls">    
                <input type="text" class="span3" name="Pengelola[nama_png]" id="pengelola_nama_png" />
                <!--button class="btn btn-primary" id="btn_search" type="submit" name="btn_search">Cari</button-->
            </div>
        </div>

        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            //'type' => 'primary',
            'icon' => 'search',
            'htmlOptions' => array(
                'id' => 'btn_search',
                'style' => 'margin-left:20px;',
            ),
            'label' => 'Cari',
        ));
        ?>
    </div>
</form>



<?php
$this->widget('bootstrap.widgets.TbGridView', array(
    'id' => 'Rekening',
    'dataProvider' => $modelRekening->search(),
    'type' => 'striped bordered condensed',
    //'htmlOptions' => array('style' => 'width:130%'),
    'columns' => array(
        array(
            'header' => 'Nomor Rekening',
            'value' => '$data->no_rekening',
        ),
        array(
            'header' => 'Nama Rekening',
            //'htmlOptions' => array('style' => 'text-align:center'),
            'value' => '$data->nama_rekening',
        ),
        //array(
//            'value' => 'CHtml::submitButton("Pilih",
//                array(
//                "kode_png"=>$data->kode_png,
//                "nama_png"=>$data->nama_png,                
//                "onClick"=>"PilihLokasi
//                ($(this).attr(\'kode_png\'),                
//                $(this).attr(\'nama_png\'))",
        array(
            'value' => 'CHtml::Button("Pilih",
                array("onClick" => "PilihRekening(\'".$data->no_rekening."#".
                $data->nama_rekening."\'
                )",
				"class"=>"btn btn-info",
				))',
            'type' => 'raw',
            'htmlOptions' => array(
                'style' => 'text-align:center',
            ),
        ),
    ),
));
?>


<?php
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>

<!-- begin dialog data NWPD -->
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
    'id' => 'dialog-datanpwpd',
    'options' => array(
        'title' => 'Cari Data NPWPD',
        'overflow' => 'scroll',
        'width' => 900,
        'height' => 500,
        'autoOpen' => false,
    ),
));
?>

<?php
Yii::app()->clientScript->registerScript('datanpwpd', "
			$('form#wajibpajak').submit(function(){
				$.fn.yiiGridView.update('DataNpwpd', {
					data: $(this).serialize()
				});
				return false;
			});
		
		");
?>

<form method="get" class="form-horizontal" action="<?php echo Yii::app()->createUrl($this->route); ?>" id="datanpwpd">
    <div class="alert alert-info">
        <div class="control-group">
            <label class="control-label">NPWPD </label>
            <div class="controls">
                <input type="text" class="span3" name="DataNpwpd[npwpd]" id="datanpwpd_npwpd" /> 
            </div>
        </div>

        <div class="control-group">
            <label class="control-label">Nama Wajib Pajak </label>
            <div class="controls">    
                <input type="text" class="span3" name="DataNpwpd[nama_npwpd]" id="DataNpwpd_nama_npwpd" />
                <!--button class="btn btn-primary" id="btn_search" type="submit" name="btn_search">Cari</button-->
            </div>
        </div>

        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'icon' => 'search',
            'htmlOptions' => array(
                'id' => 'btn_search',
                'style' => 'margin-left:20px;',
            ),
            'label' => 'Cari',
        ));
        ?>
    </div>
</form>


<?php
$this->widget('bootstrap.widgets.TbGridView', array(
    'id' => 'DataNpwpd',
    'dataProvider' => $modelDataNpwpd->search(),
    'type' => 'striped bordered condensed',
    'columns' => array(
        array(
            'header' => 'NPWPD',
            'value' => '$data->npwpd',
        ),
        array(
            'header' => 'Nama Wajib Pajak',
            'value' => '$data->nama_npwpd',
        ),
        array(
            'value' => 'CHtml::Button("Pilih",
                array("onClick" => "PilihDataNpwpd(\'".$data->npwpd."#".
                $data->nama_npwpd."#".
                $data->alamat_npwpd."#".
				$data->kelurahan_npwpd."#".
                $data->kecamatan_npwpd."#".
				$data->kabupaten_npwpd."\'
                )",
				"class"=>"btn btn-info",
				))',
            'type' => 'raw',
            'htmlOptions' => array(
                'style' => 'text-align:center',
            ),
        ),
    ),
));
?>


<?php
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>
<!-- End dialog data NWPD -->